<?php
include_once('baseModel.php');


class OrderInfo extends BaseModel {
  public $_table="orderInfo";
  
  public $id;
  public $creationDate;
  public $deliveryDate;
  public $dueDate;
  public $jobNumber;
  public $office;
  public $order_id;
  
  function loadByOrderId($id) {
    $query = "SELECT * FROM " . $this->_table . " WHERE order_id = " . $id;
    $results = DBHelper::executeQuery($query);
    if(!$results) {
      return;
    }
    // we know there will be only one result
    $this->populateModel($results[0]);
    return $this;
  }
}
?>
